#ifndef FRMRCD_LSGCC_H
#define FRMRCD_LSGCC_H

#include "dev_lsg_cc.h"
#include "QCloseEvent"
#include <QWidget>
#include "QMutex"
#include "QMutexLocker"
#include "QWindowStateChangeEvent"
#include "QPaintEvent"


namespace Ui {
class FrmRcd_LSGCC;
}

//LSG Control Center Get Records Form
class FrmRcd_LSGCC : public QWidget
{
    Q_OBJECT

public:
    explicit FrmRcd_LSGCC(QWidget *parent = nullptr);
    ~FrmRcd_LSGCC();
    void init();
    void setReader(CAEDevice* m_rdr);
    void create_alarm_record_view();
    void create_day_record_view();
    void create_peopel_record_view();
    void closeEvent(QCloseEvent *e);
    void paintEvent(QPaintEvent *e);
private slots:
    void on_btn_get_record_start_clicked();

    void on_btn_get_record_stop_clicked();

    void on_btn_clear_clicked();

    void on_ckb_additional_num_total_stateChanged(int arg1);

    void on_ckb_additional_num_day_stateChanged(int arg1);

    void on_ckb_additional_rcd_day_total_stateChanged(int arg1);

    void on_ckb_additional_rcd_people_stateChanged(int arg1);

    void on_ckb_additional_alarm_stateChanged(int arg1);

public slots:
    void slot_lsgcc_get_records(vector<CRecord_Alarm> rcd_alarm,vector<CRecord_Day> rcd_day,vector<CRecord_RealTime> rcd_realtime,
                                int total_in,int total_out,int day_in,int day_out,int use_time,int loop_count);
    void slot_lsgcc_get_records_end_loop(int iret);//stop inventory ,thread ended

private:
    Ui::FrmRcd_LSGCC *ui;
    QFont fontRcd;
    INT algnRcd;
    CRFID_LSG_CC* m_rdr;
    int AdditionFlags;
    bool meta_sgnl_registed=false;
    QMutex m_mutex;
    void bind_rcd_alarm(vector<CRecord_Alarm> rcd_alarm);
    void bind_rcd_day(vector<CRecord_Day> rcd_day);
    void bind_rcd_realtime(vector<CRecord_RealTime> rcd_realtime);
    void bind_number_total_day(int total_in,int total_out,int day_in,int day_out);
};

#endif // FRMRCD_LSGCC_H
